<template>
  <dv-border-box-8 style="padding-top: 10px">
    <dv-decoration-7 style="width:100%;height:30px;">生产统计</dv-decoration-7>
    <div style="height: 250px;width: 100%;padding: 5px">
      <dv-scroll-board :config="config" />
    </div>
  </dv-border-box-8>


</template>

<script>

import {productPowerReportOverall} from "@/api/dv/carbon";

export default {
  name: "Inventory",
  data(){
    return{
      config: {

      }
    }
  },
  created() {
    this.getList()
  },
  methods:{
    getList() {
      productPowerReportOverall().then(response => {
        this.config = {
          header: ['编号', '产品', '型号', '规格', '单位', '库存', '已生产', '待生产', '碳排放'],
          data: [],
          align: ['center'],
          rowNum: 5,
          headerBGC: '#1981f6',
          headerHeight: 45,
          oddRowBGC: 'rgba(0, 44, 81, 0.8)',
          evenRowBGC: 'rgba(10, 29, 50, 0.8)'
        }
        let data = response.rows
        data.forEach((item,index) => {
          this.config.data.push([
            index + 1,
            item.materialName,
            item.materialModel,
            item.materialSpecifications,
            item.materialUnit,
            item.totalInventory,
            item.quantityProduced,
            item.producedQuantity,
            item.totalCarbonEmission
          ])
        })
      });
    },

  },
  mounted() {

  },
  beforeDestroy(){

  }
}
</script>

<style lang="scss" scoped>

</style>
